<template>
  <!-- 节点信息 -->
  <div>
    <div class="title-wrapper">
      <title-name title="节点信息"></title-name>
    </div>
    <!-- 表单信息 -->
    <custom-form ref="ruleForm" isValidate :formList="formListNode" :form="nodeInfoForm" :editModel="onlyRead ? 'V' : 'E'"
      :isEmit="false">
    </custom-form>
  </div>
</template>

<script>
import Vue from 'vue'
import moment from 'moment'
export default {
  name: 'a' + Date.now(),
  components: {
  },
  props: {
    // 只读模式
    onlyRead: {
      type: Boolean,
      default: () => false
    },
  },
  data() {
    return {
      nodeInfoForm: {
        taskName: '',
        currentUser: '',
        time: '',
      },
    }
  },
  created() {
    const {
      name
    } = this.$route.query
    this.nodeInfoForm.currentUser = Vue.getAcloudProvider().getUserInfo().name
    this.nodeInfoForm.taskName = decodeURIComponent(name)
    this.nodeInfoForm.time = moment(new Date()).format('YYYY-MM-DD HH:mm')
  },
  computed: {
    // 表单配置项
    formListNode() {
        return [
          {
            keyName: 'taskName',
            type: 'BaseInput',
            label: '当前节点名称',
            disabled: true,
            span: 8
          },
          {
            keyName: 'currentUser',
            type: 'BaseInput',
            label: '审批人',
            disabled: true,

            span: 8
          },
          {
            keyName: 'time',
            type: 'BaseInput',
            label: '审批时间',
            disabled: true,

            span: 8
          }
        ]
      }
  },
  methods: {
  },
}
</script>

<style lang="less" scoped>
.title-wrapper {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  .titleName {
    margin: 0;
  }
  .anticon {
    margin-left: 5px;
    font-size: 18px;
  }
}
</style>